package com.winz.cultureapp.adapter;

import android.content.Context;
import android.view.View;

import com.winz.cultureapp.R;
import com.winz.cultureapp.base.AbsBaseAdapter;
import com.winz.cultureapp.entity.SeatListBean.DataBean.ListBean;
import com.winz.cultureapp.entity.SeatListBean;

/**
 * 选择座位
 */
public class SelSeatSelAdapter extends AbsBaseAdapter<SeatListBean.DataBean.ListBean>{

    private OnDeleteListener listener;

    public SelSeatSelAdapter(Context context, boolean isNeedToRemember, int resid) {
        super(context, isNeedToRemember, resid);
    }

    @Override
    public void bindDatas(int position, View convertView, ViewHolder viewHolder, SeatListBean.DataBean.ListBean data) {
        viewHolder.bindTextView(R.id.tv_content,data.seatDesc);
        viewHolder.getView(R.id.iv_close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (listener != null){
                    listener.onDelete(position);
                }
            }
        });
    }

    public void setOnDeleteListener(OnDeleteListener listener){
        this.listener = listener;
    }

    public interface OnDeleteListener{
        void onDelete(int position);
    }
}
